<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .item{
            border-radius:6px;
            overflow: hidden;
            margin-bottom:10px;
            position:relative;
            background:#b2b1b1
        }
        .sr{
            background:green;
        }
        .del{position:absolute; text-decoration: none; right:10px; top:10px; cursor:pointer; color:blue}
        .del:hover{
            color:#f00;
        }
        h2{
            height: 30px;
            line-height: 30px;
            padding:5px 10px;
            color:#fff;
            margin:0;
            font-size:14px;
            background:#a26b90
        }
        p{
            display: flex;
            width:100%;
            padding:10px;
            justify-content: cneter;
            align-items: center;
        }
        p span{
            width:33%
        }
        .selectIcon{
            display: inline-block;
            color:#000;
            padding:5px 10px;
            text-decoration: none;
        }
        .selectIcon:hover{
            color:#f00;
        }
    </style>
</head>
<body>
    <a class="selectIcon" href="/list/1">支出</a>
    <a class="selectIcon" href="/list/2">收入</a>
    <% list.forEach(item=>{%>
    <div class="item">
        <a href="/delOrder/<%=item.id%>" class="del">删除</a>
        <h2 class="<%= item.type == 1?'':'sr' %>"><%= moment(item.time).format('YYYY-MM-DD') %></h2>
        <p>
            <span><%= item.purpose%></span><span><%= item.rmark%></span> <span><%= item.money%></span>
        </p>
    </div>
    <%})%>
    <div>总共有：<%= count %>条</div>
    <script>
        // function timeFormate(time){
        //     let tt = new Date(time);
        //     let yyyy = tt.getFullYear()
        //     let mm = tt.getMonth()+1
        //     let yy = tt.getDate()
        //     return `${yyyy}-${mm}-${yy}`
        // }

    </script>
</body>
</html>